from selenium.webdriver.common.by import By

from common.base import Base


# 点击后台左边栏
class BackIndex(Base):
    # 切换iframe框架
    def back_switch(self):
        self.iframe((By.ID, 'menu-frame'), 'switch')

    # 云服务中心
    def cloud_services(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-certificate active'))

    # 商品管理
    def commodity_management(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-goods'))

    # 促销管理
    def promotion_management(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-promotion'))

    # 订单管理
    def order_management(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-order'))

    # 广告管理
    def advertising_management(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-banner'))

    # 报表统计
    def report_statistics(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-stats'))

    # 文章管理
    def article_management(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-content'))

    # 会员管理
    def member_management(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-members'))

    # 权限管理
    def permission_management(self):
        self.back_switch()
        self.click((By.CLASS_NAME, 'icon-priv'))
